import { Toast } from "antd-mobile";
import type { MasksProps } from "../../../../../type/CustomerState";

const Delete: React.FC<MasksProps> = ({
  visible,
  title = "确认操作",
  message,
  onCancel,
  onConfirm,
  cancelText = "取消",
  confirmText = "确定"
}) => {
  if (!visible) return null;
  const handleConfirm = () => {
    Toast.show({
      content: '删除成功',
      position: 'bottom',
    });
    if (onConfirm) {
      onConfirm();
    }
    
    onCancel();
  };
  return (
    <div className="mask-overlay">


      <div className="mask-dialog">
        {title && <h3 className="mask-title">{title}</h3>}
        <p className="mask-message">{message}</p>

        {/* 按钮*/}
        <div className="mask-buttons">
          <button
            className="mask-btn cancel"
            onClick={onCancel}
          >
            {cancelText}
          </button>
          <button
            className="mask-btn confirm"
            onClick={handleConfirm}
          >
            {confirmText}
          </button>
        </div>
      </div>
    </div>
  );
};

export default Delete;
